<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>comic</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link type="text/css" rel="stylesheet" href="../../css/pepper-grinder/jquery-ui-1.8.16.custom.css" />
	<link type="text/css" rel="stylesheet" href="css/cartoon.css" />
	<link type="text/css" rel="stylesheet" href="../../css/popeWin.css" />
	<link type="text/css" rel="stylesheet" href="../../css/jRating.jquery.css" />
	<script type="text/javascript" src="../../js/jquery.min.js"></script>
	<script type="text/javascript" src="../../js/jquery-ui-1.8.16.custom.min.js"></script>
	<script type="text/javascript" src="../../js/jquery.mousewheel.min.js"></script>
	<script type="text/javascript" src="../../js/jRating.jquery.js"></script>
	<script type="text/javascript" src="../../js/popeScroll.js"></script>
	<script type="text/javascript" src="../../js/popeWin.js"></script>
	<script type="text/javascript" src="js/jquery.livequery.js"></script>
	<script language="JavaScript" type="text/JavaScript">
		var id;
		var videoId;
		$(document).ready(function() {
			var cururl = window.location.href;
			id = cururl.split('?')[1].split('&')[0].split('=')[1];
			videoId = cururl.split('?')[1].split('&')[1].split('=')[1];
			
			$(window).resize(function() {
				refresh();
			});
			$("#play_area").empty();
			$.getJSON("video_getVideoItemByItemId.do",{videoItemId:id},function(json){
				$("#play_title").text(json.tv_name);
				var html="<embed width='720' height='420' flashvars='&pageurl=" + json.tv_url + "&vid=" + json.tv_ver_id + "&nid=" + json.nid + "&pid=" + json.pid
					+"&jump=0&shareBtn=1&cinemaBtn=1&bfBtn=1&playListId=1&miniWinBtn=1&widerBtn=1&changeRateBtn=1&onPlayed=_onVideoPlayed&highlightBtn=1"
					+"&isWriteComm=1&autoplay=true' wmode='Opaque' allowfullscreen='true' allowscriptaccess='always' bgcolor='#000000' quality='high'"
					+"src='http://tv.sohu.com/upload/swf/20120301/Main.swf' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' id='player'>"
				$("#play_area").append(html);
			});
			$.getJSON("video_getVideoById.do",{id:videoId},function(json){
				if(json.tv_set_now!=null&&json.tv_set_total!=null){
					$("#total_now").text("共"+ json.tv_set_total +"集，更新到"+ json.tv_set_now +"集");
				}
				
			});
			$.getJSON("video_getVideoItemListById.do",{id:videoId},function(json){			
				if(json.length>1){
					$("#play_list").show();
					var htmlstr = '<div id="list_ul" style="width:100%;float: left;">';
					for(var i=0;i<json.length;i++){
						if(i%20==0){
							htmlstr +='<ul id="ul_'+ (i/20) +'" style="list-style: none;display: none;">';
							htmlstr +='<li><a id="a_'+ json[i].id +'">第'+ (i+1) +'集</a></li>';
						}else if(i%20==19){
							htmlstr +='<li><a id="a_'+ json[i].id +'">第'+ (i+1) +'集</a></li>';
							htmlstr +='</ul>';
						}else{
							htmlstr +='<li><a id="a_'+ json[i].id +'">第'+ (i+1) +'集</a></li>';
						}
					}
					htmlstr +='</div>';
					htmlstr +='<div id="nav_ul" style="width:100%;float: left;">';
					htmlstr +='<ul style="list-style: none;float: right;">';
					var num = parseInt((json.length-1)/20)+1;
					for(var j=0;j<num;j++){
						htmlstr +='<li><a id="a_'+ j +'">'+ (j+1) +'</a></li>';
					}
					htmlstr +='</ul>';
					htmlstr +='</div>';
					$("#all_list").append(htmlstr);
					$("#ul_0").show();
					$("li #a_0").css("background","url(../../image/bg/16.png)");
				}
			});
			$("#toolcontent").hover(function(){
				$(this).removeClass("transparent_0");
				$(this).addClass("transparent_class");
			},function(){
				$(this).removeClass("transparent_class");
				$(this).addClass("transparent_0");
			});

			$("#list_ul a").livequery("click",function(){ 
				$("#list_ul a").css("background","url(../../image/bg/18.png)");
				$(this).css("background","url(../../image/bg/16.png)");
				$("#play_area").empty();
				var id = this.id.split("_")[1];
				$.getJSON("video_getVideoItemByItemId.do",{videoItemId:id},function(json){
					$("#play_title").text(json.tv_name);
					var html="<embed width='720' height='420' flashvars='&pageurl=" + json.tv_url + "&vid=" + json.tv_ver_id + "&nid=" + json.nid + "&pid=" + json.pid
						+"&jump=0&shareBtn=1&cinemaBtn=1&bfBtn=1&playListId=1&miniWinBtn=1&widerBtn=1&changeRateBtn=1&onPlayed=_onVideoPlayed&highlightBtn=1"
						+"&isWriteComm=1&autoplay=true' wmode='Opaque' allowfullscreen='true' allowscriptaccess='always' bgcolor='#000000' quality='high'"
						+"src='http://tv.sohu.com/upload/swf/20120301/Main.swf' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' id='player'>"
					$("#play_area").append(html);
				});
			});
			$("#nav_ul a").livequery("click",function(){ 
				$("#nav_ul a").css("background","url(../../image/bg/18.png)");
				$(this).css("background","url(../../image/bg/16.png)");
				$("#list_ul ul").hide();
				$("#ul_"+this.id.split("_")[1]).show();
			});
			
			refresh();
		});
		
		function goback(){
			window.parent.resizeWin("cartoon1",0.6,0.9);
			window.location.href = "showCartoon.html?id="+videoId;
		}
		function refresh(){
			var winheight = $(window).height();
			var winwidth = $(window).width();
			$("#bodydiv").css("height",winheight);
			
		}
		
		function openList(){
			$("#reg_img1").hide();
			$("#reg_img2").show();
			$("#all_list").show();
		}
		
		function closeList(){
			$("#reg_img1").show();
			$("#reg_img2").hide();
			$("#all_list").hide();
		}
		
	</script>
</head>
<body style="background-color=transparent;width:100%;margin-left:0px;margin-top:0px;">
	<div id="bodydiv" style="background:url(../../image/bg/7.png)">
		<div id="play_div" style="width:100%;;float:left;">
			<div id="play_title" style="width:720px;height:20px;padding:20px 90px 0 90px;font-size: 14px;color: #fff;">
				
			</div>
			<div id="play_area" style="width:720px;height:420px;padding:20px 90px;">
			
			</div>
			<div id="play_list" style="width:720px;height:23px;padding:0 90px;display: none;">
				<div id="img_div" style="float: left;">
					<img id="reg_img1" style="width:30px;height:30px;" src="../../image/cover/others/white/MB_0019_plus.png" onclick="openList()" />
					<img id="reg_img2" style="width:30px;height:30px;display: none;" src="../../image/cover/others/white/MB_0019_plus2.png" onclick="closeList()" />
				</div>
				<div style="width:680px;float: left;padding-left:10px;line-height: 30px;font-size: 14px;"><span>剧集列表</span><span id="total_now" style="padding-left: 5px;font-size: 10px;"></span></div>
				<div id="all_list" style="margin: 0 10px;float: left;border: 1px solid #fff;padding: 10px;height: 160px;display: none;">
				
				</div>
			</div>
		</div>
		<div id="toolcontent" class="toolcontent transparent_0">
			<div style="height:100%;">
				<img title="返回" src="../../image/cover/system/white/MB_0006_back.png" style="width:60px;height:60px;cursor:pointer;float:right;padding-right:10px;" onclick="goback();" /> 
			</div>
		</div>
	</div>

		
	
	
	
</body>
</html>